package xyz.yolin.utils;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import xyz.yolin.pojo.Survey;
import xyz.yolin.service.SurveyService;

import java.util.List;

@EnableScheduling
public class ScheduleTask {

    @Autowired
    private SurveyService surveyService;
//    处理问卷状态
//    @Scheduled(cron = "* */1 * * * ?")
    @Scheduled(fixedRate = 100000)
    public void state(){
        System.out.println("执行任务....");
        surveyService.updateState();
    }
}
